#include <stdio.h>

#define CBUF_DEFAULT_BUF_SIZEB	1024

class CBuffer {
public:
	CBuffer();
	CBuffer(int bufferSize);
	CBuffer(char *buffer, int len);
	~CBuffer(void);

public:
	// void CBufInit(cbuf_t *cbuf, char *buffer, int bufferLen);
	int write(const char *writeBuffer, int bufferLengthByte);
	int read(char *readBuffer, int bufferLengthByte);
	int getDataCount(void);
	int getEmptyCount(void);

private:
	char *baseAddr;
	int phyLength;
	int readCount;
	int writeCount;
};